<%= form_for [@forum_thread, @forum_post],
  url: (@forum_post.persisted? ? simple_discussion.forum_thread_forum_post_path(@forum_thread, @forum_post) : simple_discussion.forum_thread_forum_posts_path(@forum_thread)),
  html: { data: { behavior: "comment-form" } } do |f| %>

  <% if @forum_post.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@forum_post.errors.count, "error") %> prohibited this forum_post from being saved:</h2>

      <ul>
        <% @forum_post.errors.full_messages.each do |message| %>
          <li><%= message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <div class="form-group">
    <%= f.text_area :body, placeholder: t('add_a_comment'), rows: 8, class: "form-control simplemde", data: { behavior: "comment-body" } %>
  </div>

  <div class="text-right">
    <div class="pull-left">
      <small>
        <%# Describe text formatting options here with a link %>
        <%#= link_to "Parsed with Markdown", "https://guides.github.com/features/mastering-markdown/", target: "_blank" %>
      </small>
    </div>

    <%= f.button "#{f.object.new_record? ? t('comment') : t('update_comment')  }", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving_comment')}"} %>
  </div>

<% end %>
